package com.fyt.controller;

import com.fyt.result.R;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class MysqlTestController {
    @Autowired
    private RestTemplate restTemplate;
    private static final String  mysqlProvider = "http://mysqlService/mysql/";
    @RequestMapping(value = "/mysqltest/{str}",method = RequestMethod.GET)
    public String  getlist(@PathVariable String str){
        System.out.println(mysqlProvider+str);
        return restTemplate.getForObject(mysqlProvider + str, String.class);
    }
}
